package com.mgl.movesprite.game.model;

import java.util.ArrayList;

import org.andengine.input.touch.TouchEvent;
import org.andengine.opengl.texture.region.ITextureRegion;
import org.andengine.opengl.vbo.VertexBufferObjectManager;

import com.mgl.movesprite.EntitySpriteLevelBase;
import com.mgl.movesprite.game.factory.GameObjectFactory;
import com.mgl.movesprite.game.factory.GameType;

public class BuildZone extends Tower {

	private boolean showBuildOptions = false;

	public BuildZone(float pX, float pY, ITextureRegion pTextureRegion,
			VertexBufferObjectManager pVertexBufferObjectManager,
			GameObjectFactory gameObjectFactory) {

		super(pX, pY, pTextureRegion, pVertexBufferObjectManager,
				gameObjectFactory);

	}

	@Override
	public void updateTower(float pSecondsElapsed, Level level) {

		if (showBuildOptions) {
			showBuildOptions = false;
			level.showBuildPanel(typeBuildList, this);
		}

	}

	@Override
	public boolean onAreaTouched(final TouchEvent pSceneTouchEvent,
			final float pTouchAreaLocalX, final float pTouchAreaLocalY) {

		//
		switch (pSceneTouchEvent.getAction()) {
		case TouchEvent.ACTION_DOWN:

			showBuildOptions = true;

			break;
		case TouchEvent.ACTION_MOVE:
			break;
		case TouchEvent.ACTION_UP:
			break;
		}
		return true;
	}

	@Override
	public void initTypeBuildList() {
		
		typeBuildList.add(GameType.TOWER_FIRE);
		typeBuildList.add(GameType.TOWER_WATER);
		
	}

}
